package com.anche.cywebnew.DTO;

import java.util.Calendar;
import java.util.Date;

public class HikDownloadDTO {
    private String ip;
    private short port;
    private int ch;
    private String yh;
    private String mm;
    private int startYear;
    private int startMonth;
    private int startDay;
    private int startHour;
    private int startMinute;
    private int startSecond;
    private int endYear;
    private int endMonth;
    private int endDay;
    private int endHour;
    private int endMinute;
    private int endSecond;

    public HikDownloadDTO(String[] deviceInfo, Date kssj, Date jssj) {
        this.ip = deviceInfo[1];
        this.port = Short.parseShort(deviceInfo[2]);
        this.ch = Integer.parseInt(deviceInfo[3]);
        this.yh = deviceInfo[4];
        this.mm = deviceInfo[5];
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(kssj);
        this.startYear = calendar.get(Calendar.YEAR);
        this.startMonth = calendar.get(Calendar.MONTH) + 1;
        this.startDay = calendar.get(Calendar.DATE);
        this.startHour = calendar.get(Calendar.HOUR_OF_DAY);
        this.startMinute = calendar.get(Calendar.MINUTE);
        this.startSecond = calendar.get(Calendar.SECOND);
        calendar.setTime(jssj);
        this.endYear = calendar.get(Calendar.YEAR);
        this.endMonth = calendar.get(Calendar.MONTH) + 1;
        this.endDay = calendar.get(Calendar.DATE);
        this.endHour = calendar.get(Calendar.HOUR_OF_DAY);
        this.endMinute = calendar.get(Calendar.MINUTE);
        this.endSecond = calendar.get(Calendar.SECOND);
    }

    @Override
    public String toString() {
        return "HikDownloadDTO{" +
                "ip='" + ip + '\'' +
                ", port=" + port +
                ", ch=" + ch +
                ", yh='" + yh + '\'' +
                ", mm='" + mm + '\'' +
                ", startYear=" + startYear +
                ", startMonth=" + startMonth +
                ", startDay=" + startDay +
                ", startHour=" + startHour +
                ", startMinute=" + startMinute +
                ", startSecond=" + startSecond +
                ", endYear=" + endYear +
                ", endMonth=" + endMonth +
                ", endDay=" + endDay +
                ", endHour=" + endHour +
                ", endMinute=" + endMinute +
                ", endSecond=" + endSecond +
                '}';
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public short getPort() {
        return port;
    }

    public void setPort(short port) {
        this.port = port;
    }

    public int getCh() {
        return ch;
    }

    public void setCh(int ch) {
        this.ch = ch;
    }

    public String getYh() {
        return yh;
    }

    public void setYh(String yh) {
        this.yh = yh;
    }

    public String getMm() {
        return mm;
    }

    public void setMm(String mm) {
        this.mm = mm;
    }

    public int getStartYear() {
        return startYear;
    }

    public void setStartYear(int startYear) {
        this.startYear = startYear;
    }

    public int getStartMonth() {
        return startMonth;
    }

    public void setStartMonth(int startMonth) {
        this.startMonth = startMonth;
    }

    public int getStartDay() {
        return startDay;
    }

    public void setStartDay(int startDay) {
        this.startDay = startDay;
    }

    public int getStartHour() {
        return startHour;
    }

    public void setStartHour(int startHour) {
        this.startHour = startHour;
    }

    public int getStartMinute() {
        return startMinute;
    }

    public void setStartMinute(int startMinute) {
        this.startMinute = startMinute;
    }

    public int getStartSecond() {
        return startSecond;
    }

    public void setStartSecond(int startSecond) {
        this.startSecond = startSecond;
    }

    public int getEndYear() {
        return endYear;
    }

    public void setEndYear(int endYear) {
        this.endYear = endYear;
    }

    public int getEndMonth() {
        return endMonth;
    }

    public void setEndMonth(int endMonth) {
        this.endMonth = endMonth;
    }

    public int getEndDay() {
        return endDay;
    }

    public void setEndDay(int endDay) {
        this.endDay = endDay;
    }

    public int getEndHour() {
        return endHour;
    }

    public void setEndHour(int endHour) {
        this.endHour = endHour;
    }

    public int getEndMinute() {
        return endMinute;
    }

    public void setEndMinute(int endMinute) {
        this.endMinute = endMinute;
    }

    public int getEndSecond() {
        return endSecond;
    }

    public void setEndSecond(int endSecond) {
        this.endSecond = endSecond;
    }
}
